<include file="Public/header" />
<title>管理员列表</title>
</head>
<body>
<div class="pd-5">
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">已绑定列表</th>
			</tr>
			<tr class="text-c">
				<th>序号</th>
				<th width="">发票代码</th>
				<th width="">税号</th>
				<th width="">发票台头</th>
				<th width="">总金额</th>
				<th width="">付款人(单位)</th>
				<th width="">收款人(单位)</th>
				<th width="">企业名称</th>
				<th width="">开票日期</th>
				<th width="">发票种类</th>
				<th width="">备注</th>
			</tr>
		</thead>
		<tbody>
			<volist name="bind_bill_list" id="vs">
			<tr class="text-c">
				<td><{$i}></td>
				<td><{$vs.no}></td>
				<td><{$vs.tax_no}></td>
				<td><{$vs.head_text}></td>
				<td><{$vs.count_price}></td>
				<td><{$vs.payer}></td>
				<td><{$vs.payee}></td>
				<td><{$vs.company_name}></td>
				<td><{$vs.create_bill_time|date="Y-m-d",###}></td>
				<td><{$vs.billcate_name}></td>
				<td><{$vs.mark}></td>
				
			</tr>
			</volist>
		</tbody>
	</table>
	
		<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<form class="formleft" name="" id="" action="__URL__/bill/" method="get">
			<span class="select-box" style="width:150px">
				<select class="select" id="selval" name="selval">
					<option value="1">发票代码</option>
				</select>
			</span>
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['keywords']}>" placeholder="输入查询关键词" name="keywords" datatype="*" nullmsg="请填写搜索词">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">发票列表</th>
			</tr>
			<tr class="text-c">
				<td><input type="checkbox"  name="" value="" name=""></td>
				<th>ID</th>
				<th width="">发票代码</th>
				<th width="">税号</th>
				<th width="">发票台头</th>
				<th width="">总金额</th>
				<th width="">付款人(单位)</th>
				<th width="">收款人(单位)</th>
				<th width="">企业名称</th>
				<th width="">开票日期</th>
				<th width="">发票种类</th>
				<th width="">备注</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input type="checkbox" class="ids" name="ids" value="<{$vo.id}>" name=""></td>
				<td><{$vo.id}></td>
				<td><{$vo.no}></td>
				<td><{$vo.tax_no}></td>
				<td><{$vo.head_text}></td>
				<td><{$vo.count_price}></td>
				<td><{$vo.payer}></td>
				<td><{$vo.payee}></td>
				<td><{$vo.company_name}></td>
				<td><{$vo.create_bill_time|date="Y-m-d",###}></td>
				<td><{$vo.billcate_name}></td>
				<td><{$vo.mark}></td>
				
			</tr>
			</volist>
		</tbody>
	</table>
	<div style="margin-top: 32px;">
				<a href="javascript:;" onclick="bind()" class="btn btn-primary radius"><i class="Hui-iconfont"></i>绑定</a>
            </div>
	<div class="pages mt" style="text-align:right"><{$page}></div>
</div>
<include file="Public/footer_js" />
<script>
	function bind(){
			var option = $(".ids");
			var checked_counts=0;
			var check_val = [];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			if(checked_counts==0){
				layer.msg('至少选中一个');
				return false;
			}else{
				$.ajax({
					type: 'POST',
					data: {ids:check_val,id:<{$Think.get.id}>},
					url: "<{:U('bind_list_bill')}>",
					success:function(data){
						if(data.status==1){	//检查通过，跳转生成波次单页面
							layer.msg(data.message,function(){
								window.location.reload();
							});
							
						}else{				//检查未通过，刷新页面
							layer.msg(data.message);
						}
						return false;
					}
				})
			}
    }

</script>
</body>
</html>